package com.lazy.utils.utils;


import java.util.List;
import java.util.Map;


public final class ResultUtils {

    public static Result successResult() {
        return new Result(Responses.SUCCESS.getCode(), Responses.SUCCESS.getMessage());
    }

    public static Result errorResult() {
        return new Result(Responses.FAIL.getCode(), Responses.FAIL.getMessage());
    }

    public static Result errorResult(Exception e) {
        return new Result(Responses.FAIL.getCode(), e.getMessage());
    }

    public static Result errorResult(String message) {
        return new Result(Responses.FAIL.getCode(), message);
    }

    public static Result listResult(List<?> dataList) {
        return new Result(Responses.SUCCESS.getCode(), Responses.SUCCESS.getMessage(), dataList);
    }

    public static Result mapResult(Map<?, ?> mapList) {
        return new Result(Responses.SUCCESS.getCode(), Responses.SUCCESS.getMessage(), mapList);
    }

    public static Result objectResult(Object result) {
        return new Result(Responses.SUCCESS.getCode(), Responses.SUCCESS.getMessage(), result);
    }


}
